package com.css.influence.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.css.influence.entity.SettingSeismicInfluenceflied;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Dbj
 * @date 2024年10月14日  11:16
 */
@Mapper
public interface SettingInfluenceMapper extends BaseMapper<SettingSeismicInfluenceflied> {
    @Select("select *,st_astext(geom) geomText from setting_seismic_influenceflied where earth_quake_id=#{earthQuakeId} and version=#{influenceVersion}")
    List<SettingSeismicInfluenceflied> selectList1(@Param("influenceVersion") String influenceVersion, @Param("earthQuakeId") String earthQuakeId);


    @Select("select distinct version,type,operate_time from setting_seismic_influenceflied where earth_quake_id=#{earthQuakeId} order by operate_time desc limit 1")
    List<SettingSeismicInfluenceflied> selectListByConditionCurrent(String earthId);

    @Select("select distinct version,type,operate_time from setting_seismic_influenceflied where earth_quake_id=#{earthQuakeId} order by operate_time desc ")
    List<SettingSeismicInfluenceflied> selectListByCondition(String earthId);

    @Select("select *,st_astext(geom) geomText from setting_seismic_influenceflied where earth_quake_id=#{earthId} and version=#{version} order by dz_intensity ")
    List<SettingSeismicInfluenceflied> selectInfluence(@Param("earthId") String earthId, @Param("version") String version);
}
